#ifndef HLS_PROTOCOL_OPERATION_H_
#define HLS_PROTOCOL_OPERATION_H_

#include "http_protocol_operation.h"
#include "protocol_operation.h"

#include <cstdint>
#include <string>

class HlsM3u8Parser;
class HlsM3U8Message;
class HlsProtocolOperation : public ProtocolOperation
{
public:
    HlsProtocolOperation();
    virtual ~HlsProtocolOperation();
    int              ParserProtocol(const uint8_t * data, int data_length, int & length) override;
    int              OpSuccess() const;
    HlsM3U8Message * M3U8Msg() const;
    void             ClearMsg();
    HttpProtocolOperation * HttpProtocolOperate();
private:
    HttpProtocolOperation m_http_protocol;
    HlsM3u8Parser *       m_hls_parser = nullptr;


private:
    std::string m_http_code;
    std::string m_http_note;
};

class HlsProtocolOperationFactory : public ProtocolOperationFactory
{
public:
    HlsProtocolOperationFactory() = default;
    ~HlsProtocolOperationFactory() override = default;
    std::shared_ptr<ProtocolOperation> CreateProtocolOperation() override;
};

#endif
